<template>
  <div class="storeCheck">
    <navSearch :formList="formList" @btnSearch="btnSearch">
    </navSearch>
    <div class="one">
    <div class="two">
    <el-table
    :data="auditData"
    style="width: 100%"
    max-height="650">
    <el-table-column
      fixed
      prop="storeSerialNumber"
      label="店铺编号"
      width="167">
    </el-table-column>
    <el-table-column
      prop="storeName"
      label="店铺名称"
      width="167">
    </el-table-column>
    <el-table-column
      prop="storeIndustry"
      label="店铺行业"
      width="167">
    </el-table-column>
    <el-table-column
      prop="storeSite"
      label="店铺地址"
      width="167">
    </el-table-column>
    <el-table-column
      prop="phone"
      label="联系电话"
      width="167">
    </el-table-column>
    <el-table-column
      prop="promoterId"
      label="推广ID"
      width="167">
    </el-table-column>
    <el-table-column
      prop="state"
      label="状态"
      width="167">
      <template slot-scope="{row}">
        {{ row.state | filterState }}
      </template>
    </el-table-column>
    <el-table-column
      prop="remark"
      label="备注"
      width="167">
    </el-table-column>
    <el-table-column
      fixed="right"
      label="操作"
      width="167">
      <template slot-scope="{row}">
        <el-button
          v-if="!(row.state == 1)"
          @click.native.prevent="storeAudit(row)"
          type="text"
          size="small">
          审核
        </el-button>
      </template>
    </el-table-column>
  </el-table>
    </div>

  </div>
  </div>
</template>

<script>
import { getStoreAudit } from '@/api/storeAudit'
// storeSerialNumber   店铺编号
// storeName               店铺名称
// storeIndustry           店铺行业
// storeSite                  店铺地址
// phone                     联系电话
// promoterId                 推广人ID
// state                        状态
// remark                     备注
// operation                 操作
export default {
  name: 'storeCheck',
  created(){
    this.getStoreAudit()
  },
  methods: {
    async getStoreAudit(){
      this.auditData =  await getStoreAudit()
    },
    storeAudit (obj) {
      const { id } = obj
      this.$router.push({ name: 'audit' })
    },
    btnSearch() {
      alert(`11`)
    }
  },
  data () {
    return {
      formList: {
        user: true,
        earnings: true
      },
      showsmall: true,
      formList: {
        store: true,
        firmNameS: true
      },
      auditData: []
    }
  },
  filters:{
    filterState(state){
      if(state == '0'){
        return '未审核'
      }else if(state == '1'){
        return '审核成功'
      }else{
        return '审核失败'
      }
    }
  }
}
</script>

<style lang="less" scoped>
.one {
  .two{
    color: green;
  }
}
</style>
